From: Daniel Boles Date: Tue, 29 Aug 2017 10:24:19 +0000 (+0100) Subject: Expander: Don’t set event_window over whole widget X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~39^2~275 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=18a6c5c4c68bd4eec99a4e0659b769f0b3ad42e0;p=gtk%2B3.0.git Expander: Don’t set event_window over whole widget realize() gave the event_window the allocation of the whole widget. This was wrong; it should be that of the title_gadget, as in size_allocate(). This broke expanders in which :expanded is TRUE before showing: Input over the entire widget was sent to the title, making the child unable to receive it. Clicking the child unexpectedly collapsed it. Once expanded again, things fixed themselves as size_allocate() fixed the event_window alloc. So, queuing a reallocate or resize after show() was a workaround. Fix by giving event_window the allocation of the title_gadget, to match what size_allocate() does. That is symmetrical and just plain correct. https://bugzilla.gnome.org/show_bug.cgi?id=774134 --- diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index 89f7582bdc..609899d84c 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -602,7 +602,7 @@ gtk_expander_destroy (GtkWidget *widget) static void gtk_expander_realize (GtkWidget *widget) { - GtkAllocation allocation; + GtkAllocation title_allocation; GtkExpanderPrivate *priv; GdkWindow *window; GdkWindowAttr attributes; @@ -610,13 +610,13 @@ gtk_expander_realize (GtkWidget *widget) priv = GTK_EXPANDER (widget)->priv; - gtk_widget_get_allocation (widget, &allocation); + gtk_css_gadget_get_border_allocation (priv->title_gadget, &title_allocation, NULL); attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = allocation.x; - attributes.y = allocation.y; - attributes.width = allocation.width; - attributes.height = allocation.height; + attributes.x = title_allocation.x; + attributes.y = title_allocation.y; + attributes.width = title_allocation.width; + attributes.height = title_allocation.height; attributes.wclass = GDK_INPUT_ONLY; attributes.event_mask = gtk_widget_get_events (widget) | GDK_BUTTON_PRESS_MASK